Multiprocessor systems typically include one or more processors and some form of memory (e.g., RAM). Conventionally, in multiprocessor systems, a portion of memory is shared between some or all of the processors in the system (i.e., shared memory). Processes (threads) executing on each processor use shared memory to read and write data during execution. Shared memory is typically divided into regions, and each region is mapped into the physical address space of the processes that are sharing the memory. To prevent multiple processes from accessing the same memory locations and overwriting data, processes are only permitted to access the region of shared memory allocated to each process or to the processor on which the process is executing. To ensure that illegal memory accesses (i.e., memory accesses by processes on a processor to regions that are not allocated for that processor) are not permitted, typically, processors include functionality to perform memory protection functions to check whether each request for access to a particular memory address in shared memory is a legal memory access request.
One method used to control and protect shared memory on multiprocessor systems involves the use of virtual memory management. Virtual memory is a range of addressable locations independent from the size of physical memory. Specifically, virtual memory is a form of memory management in which large programs (i.e., programs that requires more physical memory than is available) are stored after being broken up into separate, independent sections. Typically, one section is “overlaid” on top of another when that particular section is to be executed. Virtual memory is typically implemented using paging. In paging, the low order bits of the binary representation of the “virtual address” (i.e., the address provided by software that does not directly reference physical main memory) are preserved, and used directly as the low order bits of the actual physical address; the high order bits are treated as a key to one or more address translation tables, which provide the high order bits of the actual physical address. Thus, a range of consecutive addresses in the virtual address space whose size is a power of two is translated into a corresponding range of consecutive physical addresses. The memory referenced by such a range is called a page.
When a physical memory location is read or written to by a processor, the virtual address is translated into the actual physical address in which the instructions/data are placed. The process of mapping a virtual address to a physical address is called virtual address translation. The virtual-to-physical mappings are maintained by the operating system and the memory management unit (MMU) of a multiprocessor system. Specifically, the MMU translates virtual-to-physical addresses using a page table, where the page table is a process-specific table that stores the virtual-to-physical address mappings associated with each process. Thus, each virtual memory address requires two physical memory references: one for the page table to obtain the mapping of the virtual memory address, and one to the actual physical memory address.
Because the requirement of two physical memory references is a performance penalty, typically, most multiprocessor systems include a small associative memory, known as a translation look-aside buffer (TLB), which contains the last few virtual addresses and their corresponding physical addresses. The TLB eliminates the need for the page table physical memory reference by caching recent virtual to physical address mappings. Because the TLB is tightly-coupled to the processor, in some cases, protecting shared memory using a TLB becomes difficult with large scale distributed systems that include several processes executing in parallel.